package t03;
/**
 * 有底薪的销售员
 */
public class BasePlusSalesEmployee extends Employee {
    private double baseSalary;//基本工资
    private double sales;//销售额
    private double commissionRate;//提成比率

    public BasePlusSalesEmployee(String name, int age, double baseSalary, double sales, double commissionRate) {
        // 将销售额存入父类所提供的salary属性中
        super(name, age, sales);
        this.baseSalary = baseSalary;
        this.sales = sales;
        this.commissionRate = commissionRate;
    }

    @Override
    public double getSalary() {
        //提成+底薪
        return super.getSalary() * commissionRate + baseSalary;
    }
}
